#pragma once

#include "EquippableItem.h"
#include "ObjectDatabase.h"

class Armor : public EquippableItem {
protected:
	ArmorPrefix m_prefix;
	ArmorSuffix m_suffix;
	MaterialType m_materialType;
	bool m_highQuality;
	int m_armor;
	int m_dodge;
	int m_defaultArmor;
	int m_defaultDodge;
	bool isEnchanted() const;
	void calculateStats(const ArmorInfo& info);
public:
	Armor(ArmorType type, MaterialType materialType, ArmorPrefix prefix = AP_NONE, ArmorSuffix suffix = AS_OF_NONE, bool highQuality = false);
	Armor(std::ifstream& file);
	~Armor();
	void render(float x, float y);
	void logDetails(TextLog& log) const;
	ArmorPrefix getPrefix() const;
	ArmorSuffix getSuffix() const;
	int getArmor() const;
	int getDodge() const;
	bool isHighQuality() const;
	std::string getItemName(int mod = 0) const;
	void save(std::ofstream& file) const;
};

inline ArmorPrefix Armor::getPrefix() const {return m_prefix;}
inline ArmorSuffix Armor::getSuffix() const {return m_suffix;}
inline int Armor::getArmor() const {return m_armor;}
inline int Armor::getDodge() const {return m_dodge;}
inline bool Armor::isHighQuality() const {return m_highQuality;}
